<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
	<title>Site Administration</title>
    <?php echo javascript_defaults()?>
    <script src="<?php echo get_installed_path() ?>/js/admin.js" type="text/javascript" language="javascript" charset="utf-8"></script>
    <link rel="stylesheet" href="<?php echo get_installed_path() ?>/css/forms.css" type="text/css" media="screen" title="no title" charset="utf-8" />
    <link rel="stylesheet" href="<?php echo get_installed_path() ?>/css/admin.css" type="text/css" media="screen" title="no title" charset="utf-8" />
        
    <style type="text/css" media="screen">
    /* <![CDATA[ */
        body, .submit {
            font-size:xx-small;
            text-align:left;
        }
        body {
            background:  #fff;
        }
        th {
            text-align:left;
            font-size:110%;
        }
        #wrap {
            padding:0px;
            border:0;
        }
        #add_new {
            margin:0;
            text-align:left;
        }
        input, img {
            border:0;
        }
        #breadcrumb {
            padding:3px;      
            margin:5px 0;  
            font-size:medium;
            border-bottom:1px solid #ccc;
        }
        #help_legend {
            margin: 3px;
            font-size: x-small;
            text-align: right;
        }
    /* ]]> */
    </style>
    <script language="javascript" type="text/javascript" src="<?php echo get_installed_path() ?>/js/tiny_mce/tiny_mce_popup.js"></script>

    <script language="javascript" type="text/javascript">
    	<!--
        function insertFile(URL,title,type,id) {
            // check for iframe insert like from news section
            if (typeof(parent.insert_file_from_iframe) == "function")
            {
                parent.insert_file_from_iframe(URL,title,type,id);
                return;
            }

            //var URL = document.my_form.my_field.value;
            var win = tinyMCE.getWindowArg("window");

            // insert information now
            win.document.getElementById(tinyMCE.getWindowArg("input")).value = URL;

            // for image browsers: update image dimensions
            if (win.getImageData) win.getImageData();
            win.showPreviewImage(URL);
            // close popup window
            tinyMCEPopup.close();
        }


        function insertFile__old(href,title,type,id){
            if (window.opener && inst) {
                if (type == "img" && inst.selection.getSelectedText() == '') {
                    var htmltext = "<img src='"+href+"' alt='"+title+"' />"
                } else {
                    var f_text = inst.selection.getSelectedText();
                    if (f_text == '') {
                        f_text = href.split("/").last();
                    }
                    var htmltext = "<a href='"+href+"' title='"+title+"'>"+f_text+"</a>"
                }		    
                window.opener.tinyMCE.execCommand('mceInsertContent',false,htmltext);
                tinyMCEPopup.close();
            } else {
                // implement this function on the parent holding
                // the iframe to get the selected file_id
                if (typeof(parent.insert_file_from_iframe) == "function")
                {
                    parent.insert_file_from_iframe(href,title,type,id);
                } else {
                    alert('iframe function not implemented!');
                }
            }
            return false;
        }
                
    	//-->
    </script>
    
</head>
<body>
    <div id='bd'>  
            <?php
                if ( $msg = flash('notice') )
                {
                    echo "<div id='success_notices' class='flash_notice' style='display:none'>$msg</div>";
                    echo "<script>Effect.toggle('success_notices', 'appear');setTimeout(\"new Effect.Fade('success_notices')\",3000)</script>";
                }
                if ( $msg = flash('error') )
                {
                    echo "<div class='flash_error'>$msg</div>";
                }
            ?>        
            <?php echo $content_for_layout?>
    </div>
    
</body>
</html>
